package com.family.gmall.common.util;

import org.apache.commons.lang.StringUtils;
import javax.servlet.http.HttpServletRequest;

/**
 * @Auther: family
 * @Date: 2023/7/27 17:06
 * @Description:
 */
public class AuthContextHolder {
    /**
     * 获取当前未登录临时用户id
     *
     * @param request
     * @return
     */
    public static String getUserTempId(HttpServletRequest request) {
        String userTempId = request.getHeader("userTempId");
        return StringUtils.isEmpty(userTempId) ? "" : userTempId;
    }

    public static String getUserId(HttpServletRequest request) {
        String userId = request.getHeader("userId");
        return StringUtils.isEmpty(userId) ? "" : userId;
    }

}
